package com.gitee.luosl.cola.lang.function.checked;

import java.util.function.ToLongFunction;

public interface CheckedToLongFunction<T> {
    
    long applyAsLong(T value) throws Throwable;

    default ToLongFunction<T> asToLongFunction(){
        return i -> {
            try {
                return applyAsLong(i);
            }catch (Throwable throwable){
                throw new CheckedException(throwable);
            }
        };
    }
}
